Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Table column widths

Status
Not open for further replies.

simon373

Programmer
Oct 25, 2006
25
0
0
Hi,

Is there a way to force a series of columns to align left even if the table width is much larger than the columns? At the moment they are autospacing, which is not what I want.

Thanks.
 
Table columns by default stretch to fit the table they are in, and stretch the table to fit the content.

I have to ask though is your content really tabular data, If its anything other than tabular data a table is not the most appropriate element to be used in your context.

Can you tell us what you want to accomplish?

----------------------------------
Ignorance is not necessarily Bliss, case in point:
Unknown has caused an Unknown Error on Unknown and must be shutdown to prevent damage to Unknown.
 
Because programmers love redundancy, I will echo what billyray and vacunita have already said ... and add ...

When designing layout one must evaluate all potential aspects or condition of data you intend to render. If you know for a fact that the data meant to be rendered on this page, there is no particular rule to keep you from setting your columns with fixed widths.

That said, experiment by changing the width property of the table itself or place the table within a layer which in turn has a fixed width.

Something like:
Code:
<table width="60%" ...>

or

<table width="660px" ...>

or

<div id="content" style="width: 60%;">
<table width="100%" ...>
</div>

or

<div id="content" style="width: 660px;">
<table width="100%" ...>
</div>

Hope this helps!


--
SouthBeach
The good thing about not knowing is the opportunity to learn - Yours truly, 2008.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top