answersLogoWhite

0


Best Answer

either <center> or <div align="center"> then your content and then </center> or </div> eg: <center>Hello</center> or <div align="center">Hello</div>

User Avatar

Wiki User

16y ago
This answer is:
User Avatar
More answers
User Avatar

Wiki User

15y ago

For unordered list:

<ul style="text-align:center">

<li>Item</li>

</ul>

Ordered list:

<ol style="text-align:center">

<li>Item</li>

</ol>

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

When you add a table inside of another table in HTML, the second table is said to be "nested."

Nesting tables is straightforward. You simply define the HTML for the inner table within a table cell of the outer table. For instance

This is a cell

Nested table cell 1NT Cell 2

The important part of this is to keep track of what HTML elements are open as it's easy to become confused. You might want to create the inner table in a separate file and then copy and past the entire thing at once, into the cell you're aiming for.

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

You use the CSS "margin" property to center a table in an HTML or XHTML document.

To do this, you're going to set the left and right margin to "auto."

So...

<table class="test-table">

...

</table>

Given this sample table, you want to add the following rule to your style sheet. For the example, I'm going to use an internal stylesheet.

<style type="text/css">

table.test-table { margin-right:auto; margin-left:auto; }

</style>

You can also use the margin short-hand property, giving us, instead

table.test-table { margin: 0 auto; }

In that case, the first value is for the top and bottom, and the second for right and left. In the more elaborate short-hand (top, right, bottom, left) it would be the same as margin: 0 auto 0 auto;

Obviously, you can also put this directly into a style attribute on the table tag if you're in a pinch.

<table style="margin: 0 auto;">

But you want to avoid this if there's going to be more than one occurrence of a centered table on the site.

This answer is:
User Avatar

User Avatar

Wiki User

15y ago
AnswerAdd
margin: 0px auto; to the style attribute of the table.

e.g.
This answer is:
User Avatar

User Avatar

Wiki User

15y ago

Here is an example:

<img src="./image/myImage.png" alt="My Image" style="width:100px;height:100px;float:left;margin:0 auto;" />

That will centre your image.

This answer is:
User Avatar

User Avatar

Wiki User

15y ago

I'd use div tags:

<div style="position:absolute;top:100px;">

put whatever you want in here

</div>

This answer is:
User Avatar

User Avatar

Wiki User

12y ago

<center><h1>Your header<h1></center>

This answer is:
User Avatar

Add your answer:

Earn +20 pts
Q: How do you center text with HTML code?
Write your answer...
Submit
Still have questions?
magnify glass
imp
Related questions

What Is The Code To Show An Html A Text?

&lt;code&gt;&lt;code&gt;HTML TEXT HERE&lt;/code&gt;&lt;/code&gt;


What is the code to center a heading in HTML?

The CENTER tag in HTML is used to center blocks of code within an HTML document. The tag is very easy to use as you only have to open it and close it around the text you want centered. This can be 2 lines of text or an entire webpage. See the example below. &lt;center&gt; Smasher is teaching me HTML &lt;/center&gt; This would take the text and center it on the screen. If you want to center the whole page simply put the open tag at the beginning of the document and the close tag at the end.


How would you center your writing on blog?

If the text editor does not have a centred text option you can add HTML code to achieve this: &lt;div align = center&gt; This is centred! &lt;/div&gt; replacing This is centred! with your own text.


What is the code for HTML when combining centered text and color?

in the tag you will put align="center" style: font color="#ffffff"&gt; Example: &lt; p align="center" style: font color="#FFFFFF"&gt;This is the centered text&lt;/p&gt; and that code will center "This is the centered text" in white.


What does div mean?

A div tag in HTML represents a division, usually with its own style, class, or alignment. For example, the HTML &lt;div align=center&gt;Text&lt;/center&gt; would align the text in the center of the page


What is HTML View?

The view of the website in form of HTML is HTML view. It is the basic code you write in text editor.


Is there a code that centers your text on MySpace?

You can center your text by Copy and Paste this: &lt;center&gt;ENTER TEXT&lt;/center&gt;


What is the code inside the HTML?

hyper text markup language


What does the HTML code marquee mean?

Your text will move when you use it.


What is the use of CENTER TAG in HTML?

The &lt;Center&gt; tag is used to center the text that follows the tag on the web page. All the text that is typed between the &lt;Center&gt; and &lt;/Center&gt; tags will be centered and displayed on screen.


Is it true HTML code needs to be complied before it run in order for it to work?

No HTML can be written in a simple text file and saved as .html.


Long form of HTML?

To code HTML, you'll need a text editor such as Notepad or Notepad++. You can write your HTML code in there and save the pages as "something.html". Make sure you have the ".html" extension. If you double click the file you have made, it will open up a web browser and you'll see what your HTML has done.