Question:
How can I dictate column width in an HTML table?
TheNineofSpades
2008-03-27 20:22:06 UTC
I know how to define table width, but the individual columns are defined by content -- columns with more in them are wider. But I want them to all be a uniform width. How do I dictate this?
Three answers:
jtaber79
2008-03-27 20:29:03 UTC
Lets say you have a table that is 600 pixels wide.



And you want 2 columns



The Code would be:













Column 1 Column 2




You simply divide the total width of your table by the number of columns to get the static width.



You could also use percentages/dynamic width













Column 1 Column 2
rockinronnie
2008-03-28 03:25:39 UTC
duct_tape_is_good
2008-03-28 03:35:03 UTC
use css..



table td {

width:300px;

}


This content was originally posted on Y! Answers, a Q&A website that shut down in 2021.
Loading...