473,760 Members | 10,633 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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><ti tle>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,Ver dana" size="2">
<form name="OutOfBox" action="OutOfBo x.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"><fo nt face="Arial" size="4"><b>Ste p 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 15976
ve**********@ho tmail.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
6177
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: https://fshn3152.foods.uiuc.edu/~fgasper/erf.html what I'm immediately trying to do is vertically position the text and checkboxes in all four "Statement Date" sub-cells (created with <span> elements).
10
2046
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, it pushes the content out past the right edge of the item. How can I get it to behave? -- Alan Little Phorm PHP Form Processor http://www.phorm.com/
1
2275
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 with linked tables and Access 2000 but the threads are dated about 3 years ago. I am running XP Home Edition Version 2002 SP1 and Access 2002 (10.2627.2625). I have checked on the Microsoft Upgrade site and although upgrades are available they...
3
1716
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) Is it a way with an sql command? INSERT INTO TAB1... (select * from TAB2) ??? thanks fx
1
1736
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 ProductsSold, ai.first_name as Cust_FirstName, ai.last_name as Cust_LastName,
36
3050
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 get this kind of inconsistent result. -- ----------------------------------------------------------------------------- | Phil Howard KA9WGN | http://linuxhomepage.com/ http://ham.org/ |
1
2357
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 = Page.FindControl("maincontent") maincontent2.Attributes.Add("onload", "style='padding-left:10px;'")
2
774
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 width of it (short of putting a div inside each <tdand making it a specific width?) what's the point of "padding" property if instead of adding just the
1
2221
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 database ASPNETDB. (not sure name is correct?). But instead of that I want to use another database I create on my own. A database created in Sql Server 2005. So how do I create these Membership tables and stored procedures in this database. I've done...
0
9521
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9333
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10107
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9945
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
0
8768
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6599
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5361
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3863
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2733
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.