הוסטס - פורום אחסון האתרים הגדול בישראל

הוסטס - פורום אחסון האתרים הגדול בישראל (https://hosts.co.il/forums/index.php)
-   פורום תיכנות (https://hosts.co.il/forums/forumdisplay.php?f=14)
-   -   רווח בין תא ושורה בדיב. (https://hosts.co.il/forums/showthread.php?t=86656)

dor77 07-12-10 00:35

רווח בין תא ושורה בדיב.
 
יש לי את הקוד הבא:

PHP קוד:


<!DOCTYPE HTML>
<
html>
<
head>
<
meta http-equiv="Content-Type" content="text/html; charset=utf-

8"
>
<
title>Untitled Document</title>
<
style>
    .
table {
        
border:solid #c0c0c0;
        
border-width:1px 1px 0px 0px;
    }
    .
row {
        
overflow:auto;
        
border-bottom:solid 1px #c0c0c0;
        
    
}
    .
cell{
        
float:left;
        
text-align:center;
        
border:solid #c0c0c0;
        
border-width:0px 0px 0px 1px;
        
    }
</
style>
</
head>

<
body>
<
div class="table" style="width:500px;margin:0 auto;">
    <
div class="row">
        <
div class="cell" style="width:33.3%">1</div>
        <
div class="cell" style="width:33.3%">2</div>
        <
div class="cell" style="width:33.3%">3</div>        
    </
div>
    <
div class="row">
        <
div class="cell" style="width:33.3%">4</div>
        <
div class="cell" style="width:33.3%">5</div>
        <
div class="cell" style="width:33.3%">6</div>      
    </
div>
    <
div class="row">
        <
div class="cell" style="width:33.3%">7</div>
        <
div class="cell" style="width:33.3%">8</div>
        <
div class="cell" style="width:33.3%">9</div>        
    </
div>
</
div>

</
body>
</
html

הכל מאוד צפוף..אני רוצה שבין כל דיב יהיה רווח כלומר אם היה כתוב:

123

אני רוצה שיהיה כתוב
1---2---3

וכנל לגבי השורות.

איך עושים זאת?
תודה!! :)

Hagaibl 07-12-10 00:41

בישביל זה יש את הדבר שנקרא margin
אתה מגדיר מרווח פשוט,
תעיף את ה.3
ובמקום תוסיף:
margin-left: 0.3%;
לתא הראשון ולתא השני בכל שורה.

dor77 07-12-10 08:07

ציטוט:

נכתב במקור על ידי Hagaibl (פרסם 788346)
בישביל זה יש את הדבר שנקרא margin
אתה מגדיר מרווח פשוט,
תעיף את ה.3
ובמקום תוסיף:
margin-left: 0.3%;
לתא הראשון ולתא השני בכל שורה.

יצא לי משהו מוזר ביותר.
תראה:
http://img143.imageshack.us/img143/1352/abcde.png

הררוח לא יוצא אחיד..
אני רוצה שזה יהיה ככה:

1---2---3
4---5---6
7---8---9

בדיוק כמו טבלה.

עשיתי מה שאמרת..איפה הבעיה?
הנה הקוד:

PHP קוד:


<!DOCTYPE HTML
<
html
<
head
<
meta http-equiv="Content-Type" content="text/html; charset=utf- 
8"

<
title>Untitled Document</title
<
style
    .
table 
        
border:solid #c0c0c0; 
        
border-width:1px 1px 0px 0px
    } 
    .
row 
        
overflow:auto
        
border-bottom:solid 1px #c0c0c0; 
         
    

    .
cell
        
float:left
        
text-align:center
        
border:solid #c0c0c0; 
        
border-width:0px 0px 0px 1px
         
    } 
</
style
</
head

<
body
<
div class="table" style="width:500px;margin:0 auto;"
    <
div class="row"
        <
div class="cell" style="width:33% margin-left:0.3%">1</div>
        <
div class="cell" style="width:33% margin-left:0.3%">2</div
        <
div class="cell" style="width:33%">3</div>         
    </
div
    <
div class="row"
        <
div class="cell" style="width:33% margin-left:0.3%">4</div>
        <
div class="cell" style="width:33% margin-left:0.3%">5</div
        <
div class="cell" style="width:33%">6</div>        
    </
div
    <
div class="row"
        <
div class="cell" style="width:33% margin-left:0.3%">7</div>
        <
div class="cell" style="width:33% margin-left:0.3%">8</div
        <
div class="cell" style="width:33%">9</div>          
    </
div
</
div

</
body
</
html

תודה!

dor77 07-12-10 08:09

הסתדרתי..היה חסר נקודה פסיק חח..אבל זה בין כל תא..איך בין כל שורה?
כאילו ככה:

1---2---3

4---6---6

7---8---9

תודה.

Hagaibl 07-12-10 10:16

מוסיך לכל
PHP קוד:

<div class="row"



הופך אותו ל
PHP קוד:

 <div class="row" style="margin-bottom: 10px;"

אני ממליץ לך לקרוא על האלמנט Margin בשפת CSS


כל הזמנים הם GMT +2. הזמן כעת הוא 20:04.

מופעל באמצעות VBulletin גרסה 3.8.6
כל הזכויות שמורות ©
כל הזכויות שמורות לסולל יבוא ורשתות (1997) בע"מ