473,378 Members | 1,309 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,378 software developers and data experts.

Adding padding to tables

I am trying to add some padding to my table; that is, I want to add
space
between the red outer border and the content within. However, setting
the
"padding : 30px;" within the TABLE area of my CSS doesn't seem to be
having
any affect. Is there a way to add padding to a table via CSS?

I can use <table CELLSPACING=[n]>, but it's a rather coarse way of
doing
so. I would prefer to add more padding to the left and right of the
main table content, but keep the top and bottom with zero space
between it and the colored border. Any advice is greatly appreciated
-- thanks in advance!
-=Tek Boy=-
================================
Begin HTML Code
================================

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html><head><title>Testing</title>
<style>
<!--
BODY {
font-family : Arial,Verdana;
font-size : 10pt;
color : #000000;
background-color : #FFFFFF;
}

HR {
height : 1px;
width : 100%;
color : #000000;
}

FORM {
margin : 0.0em;
}

input[type=text] {
background-color : #CCCCCC;
color : #000000;
}

TABLE.form {
border : 1px solid #FF0000;
border-collapse : collapse;
background-color : #FFFFCC;
margin : 0.3em 0.0em 1.0em 0.0em;
width : 450px;
padding : 30px;
}

TABLE.form TD {
padding:0px;
}

//-->
</style></head>
<body>

<font face="Arial,Verdana" size="2">
<form name="OutOfBox" action="OutOfBox.asp" method="POST">
<input type="hidden" name="NotFirst_Step1" value="True">

<center><br>
Area above table.<br>

<table class="form" cellspacing="0">
<col width="10"><col width="5"><col width="200">
<tr><td>
<tr><td colspan="4"><font face="Arial" size="4"><b>Step 01 - QDR
Core
Information</b></font></td></tr>
<tr><td colspan="4"><hr></td></tr>
<tr>
<td nowrap>&nbsp;</td>
<td nowrap><font face="Times New Roman" size="2"
color="#FF0000">*</font></td>
<td nowrap><font face="Arial" size="2">Date</font></td>
<td><input type="text" value="01/01/2003" size="34"
maxlength="75"></td>
</tr>
<tr>
<td width="10" nowrap>&nbsp;</td>
<td nowrap><font face="Times New Roman" size="2"
color="#FF0000">*</font></td>
<td width="200" nowrap><font face="Arial"
size="2">Stufff</font></td>
<td width="100%" nowrap><input type="text" value="" size="34"
maxlength="75"></td>
</tr>
<tr><td colspan="4"><hr></td></tr>
<tr><td colspan="4" align="center">
<table cellpadding="5" cellspacing="0" border="0">
<tr>
<td><input type="button" value="Submit"></td>
<td width="20" nowrap>&nbsp;</td>
<td><input type="button" value="Reset Form"></td>
</tr>
</table>
</td></tr>
</table>

Area below table.<br>
</center>

</form>
</font>

</body></html>
Jul 20 '05 #1
1 15962
ve**********@hotmail.com (Saiyan Vejita) wrote:
Is there a way to add padding to a table via CSS?
You're actually asking how to put margins between the cells. The answer is
that this can be handled using the border-spacing property, but this
property is not supported e.g. by IE 6.
I can use <table CELLSPACING=[n]>, but it's a rather coarse way of
doing so.
Indeed, but it's mostly more practical at present.
I would prefer to add more padding to the left and right of the
main table content, but keep the top and bottom with zero space
between it and the colored border.
Put the table inside a <div> element, assign the border to the <div> and
not the <table>, and use padding properties for <div> or margin properties
for <table> to achieve the desired effect.
Begin HTML Code


In future, please post a URL instead.

--
Yucca, http://www.cs.tut.fi/~jkorpela/
Jul 20 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
by: Felipe Gasper | last post by:
I'm trying to make some "sub-cells" in an HTML table and to control their positioning and content presentation via CSS. In the table at the following URL: ...
10
by: Alan Little | last post by:
Is there a way to get NS7 to right-pad? With padding-right, it's completely ignored. With padding, it pads top, bottom and left, but not right. In fact if I push the padding up to a large number,...
1
by: Mike Ridley | last post by:
I am trying to create a new query using 3 linked tables. As soon as I add the third table to the design grid Access crashes. I have looked in the newsgroup and find that there have been problems...
3
by: fx gamoy | last post by:
hello everybody, i ve got two big tables with the same structure. i would like to add the second one to the first one directly without generating a sql file. (each table is about 1 Million line)...
1
by: david.goodyear | last post by:
Hi, I have a query that gives me almost the results I want, which is SELECT ai.entry_date as CallTime, ai.agent_login as AgentsLogin, ai.campaign as MarketingCampaign, ai.agent_input2 as...
36
by: phil-news-nospam | last post by:
Here is a simpler (no drop shadows) example of the padding bug I see: http://phil.ipal.org/usenet/ciwas/2006-05-08/buttons-1.html So far I find nothing in the CSS2 document that says I should...
1
by: gomzi | last post by:
hi, I wanted to add some padding to a td tag depending on the browser type, so i tried to do it through the code shown below, Dim maincontent2 As HtmlGenericControl maincontent2 =...
2
by: maya | last post by:
hi, I discovered recently, the hard way, that adding padding-right or padding-left to a <tdadds to the width of <td>!! so how do I add left- or right-padding to a <tdwithout adding to the...
1
by: Jeff | last post by:
hey asp.net 2.0 I'm wondering how to add the Membership tables to a database. When I create a website project and wants to register users, users are then automatically registered in the...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.