Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to specify width for empty table cells

Tags:

html

in HTML if I write <td></td> it is an empty column. how can I specify how much space it will take? I want an empty column like that to take more space than its default..the goal is I want to have two text boxes in the same row of my page like this: TextBox1 somespace TextBox2 and for "somespace" I thought maybe I can use that <td></td> but it does not have enough spacing...so if you also have a better idea for how I can reach my main goal that would be cool. thanks.

like image 511
Bohn Avatar asked Jun 20 '11 15:06

Bohn


2 Answers

Use a CSS style:

td { width:42px; height:42px; }

Though, on reading your question it seems I would have to encourage you not to implement this to achieve what you desire. Instead, style the textbox controls to use a margin:

input[type="text"] { margin:12px; }

There is the possibility of separating space-wise using non-breaking white-space (&nbsp;), but I would discourage this, too, as it would be being used in the mark-up structure as a means of layout and design, when this should be dictated by abstracted styling.

like image 74
Grant Thomas Avatar answered Sep 22 '22 16:09

Grant Thomas


put a margin on your textboxes that is the space you want to be between them

have a look here, you can play with the margin to decide how much space you need

http://jsfiddle.net/tzUph/

like image 44
Patricia Avatar answered Sep 22 '22 16:09

Patricia