Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET advertisement website

Tags:

html

css

asp.net

I am currently working on a website that is an advertisement portal for businesses. Advertisers can create an account, select various options for listing (State, caregory, etc) and upload a graphic is measured in a multiples of an "unit". An "unit" is an image or a flash file that is 180px wide and 120 high. An advertiser can choose multiple units that are horizontal or vertical, i.e, 2 single units aligned horizontally or 2 single units aligned vertically.

I have gone to the point where the the website is working fine. I am stuck at a point I am going to lay out the "units" and display them properly, without any empty space between them. As an example, if we had 4 advertisements, a horizontal 2 unit ad, a vertical 2 unit and 2 single unit ad, like so -

                  |
                  |
   2 unit ad      |   2 
------------------|  unit 
        |         |   ad
1 unit  | 1 unit  | 
        |         |
        |         |

I am currently storing the advertisements units in a database with attributes that are used in the web form to build a table (i.e., colspan, rowspan, etc). I am not sure if this is the right approach, I fear it is not. I shall be very grateful if I got some advice.

Thanks, Indy

like image 528
indyfromoz Avatar asked Sep 14 '26 03:09

indyfromoz


1 Answers

IMHO tables are perfect for this job, because the ads have the same rowspan-is and colspan-ish behavior. If you have a method for generating the correct table, stick with it.

Also when I create a HTML table for layout and I do not want spaces between the cells I include cellspacing="0" and cellpadding="0" attributes, like Leah mentioned.

<table cellspacing="0" cellpadding="0" border="0">

Extra table trick:
To obtain a single pixel border between HTML table cells, use the

table 
{ 
    border-collapse: collapse; 
}

CSS property.

like image 69
Germstorm Avatar answered Sep 15 '26 18:09

Germstorm