Circular HTML table











up vote
1
down vote

favorite












I was wondering if it is possible to make a circular html table ?
In other words, I'd like to put td elements in circle. The closest example I found is this: But this is not an html table. it is a list. I tried this code but I couldn't make it work the way it should be.



I have a table like this:



<table class='ctb'>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
<td>8</td>
<td>9</td>
<td>10</td>
<td>11</td>
<td>12</td>
<td>13</td>
<td>14</td>
<td>15</td>
<td>16</td>
<td>17</td>
<td>18</td>
<td>19</td>
<td>20</td>
<td>21</td>
<td>22</td>
<td>23</td>
<td>24</td>
<td>25</td>
</tr>
</table>









share|improve this question
























  • so why do not use what you found... conver it to li
    – לבני מלכה
    Nov 8 at 9:16










  • I tried it already, but it didn't work.
    – Jason
    Nov 8 at 9:16










  • what didn't work?
    – DasSaffe
    Nov 8 at 9:21










  • td elements were not aligned in circle.
    – Jason
    Nov 8 at 9:22










  • why do you have to use a table?
    – pasine
    Nov 8 at 9:30















up vote
1
down vote

favorite












I was wondering if it is possible to make a circular html table ?
In other words, I'd like to put td elements in circle. The closest example I found is this: But this is not an html table. it is a list. I tried this code but I couldn't make it work the way it should be.



I have a table like this:



<table class='ctb'>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
<td>8</td>
<td>9</td>
<td>10</td>
<td>11</td>
<td>12</td>
<td>13</td>
<td>14</td>
<td>15</td>
<td>16</td>
<td>17</td>
<td>18</td>
<td>19</td>
<td>20</td>
<td>21</td>
<td>22</td>
<td>23</td>
<td>24</td>
<td>25</td>
</tr>
</table>









share|improve this question
























  • so why do not use what you found... conver it to li
    – לבני מלכה
    Nov 8 at 9:16










  • I tried it already, but it didn't work.
    – Jason
    Nov 8 at 9:16










  • what didn't work?
    – DasSaffe
    Nov 8 at 9:21










  • td elements were not aligned in circle.
    – Jason
    Nov 8 at 9:22










  • why do you have to use a table?
    – pasine
    Nov 8 at 9:30













up vote
1
down vote

favorite









up vote
1
down vote

favorite











I was wondering if it is possible to make a circular html table ?
In other words, I'd like to put td elements in circle. The closest example I found is this: But this is not an html table. it is a list. I tried this code but I couldn't make it work the way it should be.



I have a table like this:



<table class='ctb'>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
<td>8</td>
<td>9</td>
<td>10</td>
<td>11</td>
<td>12</td>
<td>13</td>
<td>14</td>
<td>15</td>
<td>16</td>
<td>17</td>
<td>18</td>
<td>19</td>
<td>20</td>
<td>21</td>
<td>22</td>
<td>23</td>
<td>24</td>
<td>25</td>
</tr>
</table>









share|improve this question















I was wondering if it is possible to make a circular html table ?
In other words, I'd like to put td elements in circle. The closest example I found is this: But this is not an html table. it is a list. I tried this code but I couldn't make it work the way it should be.



I have a table like this:



<table class='ctb'>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
<td>8</td>
<td>9</td>
<td>10</td>
<td>11</td>
<td>12</td>
<td>13</td>
<td>14</td>
<td>15</td>
<td>16</td>
<td>17</td>
<td>18</td>
<td>19</td>
<td>20</td>
<td>21</td>
<td>22</td>
<td>23</td>
<td>24</td>
<td>25</td>
</tr>
</table>






html css






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 8 at 9:18

























asked Nov 8 at 9:15









Jason

917




917












  • so why do not use what you found... conver it to li
    – לבני מלכה
    Nov 8 at 9:16










  • I tried it already, but it didn't work.
    – Jason
    Nov 8 at 9:16










  • what didn't work?
    – DasSaffe
    Nov 8 at 9:21










  • td elements were not aligned in circle.
    – Jason
    Nov 8 at 9:22










  • why do you have to use a table?
    – pasine
    Nov 8 at 9:30


















  • so why do not use what you found... conver it to li
    – לבני מלכה
    Nov 8 at 9:16










  • I tried it already, but it didn't work.
    – Jason
    Nov 8 at 9:16










  • what didn't work?
    – DasSaffe
    Nov 8 at 9:21










  • td elements were not aligned in circle.
    – Jason
    Nov 8 at 9:22










  • why do you have to use a table?
    – pasine
    Nov 8 at 9:30
















so why do not use what you found... conver it to li
– לבני מלכה
Nov 8 at 9:16




so why do not use what you found... conver it to li
– לבני מלכה
Nov 8 at 9:16












I tried it already, but it didn't work.
– Jason
Nov 8 at 9:16




I tried it already, but it didn't work.
– Jason
Nov 8 at 9:16












what didn't work?
– DasSaffe
Nov 8 at 9:21




what didn't work?
– DasSaffe
Nov 8 at 9:21












td elements were not aligned in circle.
– Jason
Nov 8 at 9:22




td elements were not aligned in circle.
– Jason
Nov 8 at 9:22












why do you have to use a table?
– pasine
Nov 8 at 9:30




why do you have to use a table?
– pasine
Nov 8 at 9:30












1 Answer
1






active

oldest

votes

















up vote
2
down vote



accepted










Use code as below:



See here:https://codepen.io/leenmalka/pen/rQxEea



 <table class='circle-container'>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
<td>8</td>
<td>9</td>
<td>10</td>
<td>11</td>
<td>12</td>
<td>13</td>
<td>14</td>
<td>15</td>
<td>16</td>
<td>17</td>
<td>18</td>
<td>19</td>
<td>20</td>
<td>21</td>
<td>22</td>
<td>23</td>
<td>24</td>
<td>25</td>
</tr>
</table>


Css:



@import "compass/css3";

@mixin on-circle($item-count, $circle-size, $item-size) {
position: relative;
width: $circle-size;
height: $circle-size;
border-radius: 50%;
padding: 0;

> * {
display: block;
position: absolute;
top: 50%;
left: 50%;
margin: -($item-size / 2);
width: $item-size;
height: $item-size;

$angle: (360 / $item-count);
$rot: 0;

@for $i from 1 through $item-count {
&:nth-of-type(#{$i}) {
transform: rotate($rot * 1deg) translate($circle-size / 2) rotate($rot * -1deg);
}

$rot: $rot + $angle;
}
}
}

.circle-container tr{
@include on-circle($item-count: 25, $circle-size: 20em, $item-size: 1em);
margin: 5em auto 0;
border: solid 5px tomato;

td {
display: block;
max-width: 100%;
border-radius: 50%;
filter: grayscale(100%);
border: solid 5px tomato;
transition: .15s;

&:hover {
filter: grayscale(0);
}
}
}





share|improve this answer























  • thanks, that looks great. Just a small question if you don't mind. Do I have to use divs ?
    – Jason
    Nov 8 at 9:29










  • because inside the li was img in original one I tried to use the same... the reason is :> * { in scss
    – לבני מלכה
    Nov 8 at 9:30










  • ok, thanks a lot for your help really.
    – Jason
    Nov 8 at 9:31






  • 1




    but you can do it without I edited answer:codepen.io/leenmalka/pen/rQxEea
    – לבני מלכה
    Nov 8 at 9:32












  • great! I'll use this one :)
    – Jason
    Nov 8 at 9:33











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














 

draft saved


draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53204616%2fcircular-html-table%23new-answer', 'question_page');
}
);

Post as a guest
































1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
2
down vote



accepted










Use code as below:



See here:https://codepen.io/leenmalka/pen/rQxEea



 <table class='circle-container'>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
<td>8</td>
<td>9</td>
<td>10</td>
<td>11</td>
<td>12</td>
<td>13</td>
<td>14</td>
<td>15</td>
<td>16</td>
<td>17</td>
<td>18</td>
<td>19</td>
<td>20</td>
<td>21</td>
<td>22</td>
<td>23</td>
<td>24</td>
<td>25</td>
</tr>
</table>


Css:



@import "compass/css3";

@mixin on-circle($item-count, $circle-size, $item-size) {
position: relative;
width: $circle-size;
height: $circle-size;
border-radius: 50%;
padding: 0;

> * {
display: block;
position: absolute;
top: 50%;
left: 50%;
margin: -($item-size / 2);
width: $item-size;
height: $item-size;

$angle: (360 / $item-count);
$rot: 0;

@for $i from 1 through $item-count {
&:nth-of-type(#{$i}) {
transform: rotate($rot * 1deg) translate($circle-size / 2) rotate($rot * -1deg);
}

$rot: $rot + $angle;
}
}
}

.circle-container tr{
@include on-circle($item-count: 25, $circle-size: 20em, $item-size: 1em);
margin: 5em auto 0;
border: solid 5px tomato;

td {
display: block;
max-width: 100%;
border-radius: 50%;
filter: grayscale(100%);
border: solid 5px tomato;
transition: .15s;

&:hover {
filter: grayscale(0);
}
}
}





share|improve this answer























  • thanks, that looks great. Just a small question if you don't mind. Do I have to use divs ?
    – Jason
    Nov 8 at 9:29










  • because inside the li was img in original one I tried to use the same... the reason is :> * { in scss
    – לבני מלכה
    Nov 8 at 9:30










  • ok, thanks a lot for your help really.
    – Jason
    Nov 8 at 9:31






  • 1




    but you can do it without I edited answer:codepen.io/leenmalka/pen/rQxEea
    – לבני מלכה
    Nov 8 at 9:32












  • great! I'll use this one :)
    – Jason
    Nov 8 at 9:33















up vote
2
down vote



accepted










Use code as below:



See here:https://codepen.io/leenmalka/pen/rQxEea



 <table class='circle-container'>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
<td>8</td>
<td>9</td>
<td>10</td>
<td>11</td>
<td>12</td>
<td>13</td>
<td>14</td>
<td>15</td>
<td>16</td>
<td>17</td>
<td>18</td>
<td>19</td>
<td>20</td>
<td>21</td>
<td>22</td>
<td>23</td>
<td>24</td>
<td>25</td>
</tr>
</table>


Css:



@import "compass/css3";

@mixin on-circle($item-count, $circle-size, $item-size) {
position: relative;
width: $circle-size;
height: $circle-size;
border-radius: 50%;
padding: 0;

> * {
display: block;
position: absolute;
top: 50%;
left: 50%;
margin: -($item-size / 2);
width: $item-size;
height: $item-size;

$angle: (360 / $item-count);
$rot: 0;

@for $i from 1 through $item-count {
&:nth-of-type(#{$i}) {
transform: rotate($rot * 1deg) translate($circle-size / 2) rotate($rot * -1deg);
}

$rot: $rot + $angle;
}
}
}

.circle-container tr{
@include on-circle($item-count: 25, $circle-size: 20em, $item-size: 1em);
margin: 5em auto 0;
border: solid 5px tomato;

td {
display: block;
max-width: 100%;
border-radius: 50%;
filter: grayscale(100%);
border: solid 5px tomato;
transition: .15s;

&:hover {
filter: grayscale(0);
}
}
}





share|improve this answer























  • thanks, that looks great. Just a small question if you don't mind. Do I have to use divs ?
    – Jason
    Nov 8 at 9:29










  • because inside the li was img in original one I tried to use the same... the reason is :> * { in scss
    – לבני מלכה
    Nov 8 at 9:30










  • ok, thanks a lot for your help really.
    – Jason
    Nov 8 at 9:31






  • 1




    but you can do it without I edited answer:codepen.io/leenmalka/pen/rQxEea
    – לבני מלכה
    Nov 8 at 9:32












  • great! I'll use this one :)
    – Jason
    Nov 8 at 9:33













up vote
2
down vote



accepted







up vote
2
down vote



accepted






Use code as below:



See here:https://codepen.io/leenmalka/pen/rQxEea



 <table class='circle-container'>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
<td>8</td>
<td>9</td>
<td>10</td>
<td>11</td>
<td>12</td>
<td>13</td>
<td>14</td>
<td>15</td>
<td>16</td>
<td>17</td>
<td>18</td>
<td>19</td>
<td>20</td>
<td>21</td>
<td>22</td>
<td>23</td>
<td>24</td>
<td>25</td>
</tr>
</table>


Css:



@import "compass/css3";

@mixin on-circle($item-count, $circle-size, $item-size) {
position: relative;
width: $circle-size;
height: $circle-size;
border-radius: 50%;
padding: 0;

> * {
display: block;
position: absolute;
top: 50%;
left: 50%;
margin: -($item-size / 2);
width: $item-size;
height: $item-size;

$angle: (360 / $item-count);
$rot: 0;

@for $i from 1 through $item-count {
&:nth-of-type(#{$i}) {
transform: rotate($rot * 1deg) translate($circle-size / 2) rotate($rot * -1deg);
}

$rot: $rot + $angle;
}
}
}

.circle-container tr{
@include on-circle($item-count: 25, $circle-size: 20em, $item-size: 1em);
margin: 5em auto 0;
border: solid 5px tomato;

td {
display: block;
max-width: 100%;
border-radius: 50%;
filter: grayscale(100%);
border: solid 5px tomato;
transition: .15s;

&:hover {
filter: grayscale(0);
}
}
}





share|improve this answer














Use code as below:



See here:https://codepen.io/leenmalka/pen/rQxEea



 <table class='circle-container'>
<tr>
<td>1</td>
<td>2</td>
<td>3</td>
<td>4</td>
<td>5</td>
<td>6</td>
<td>7</td>
<td>8</td>
<td>9</td>
<td>10</td>
<td>11</td>
<td>12</td>
<td>13</td>
<td>14</td>
<td>15</td>
<td>16</td>
<td>17</td>
<td>18</td>
<td>19</td>
<td>20</td>
<td>21</td>
<td>22</td>
<td>23</td>
<td>24</td>
<td>25</td>
</tr>
</table>


Css:



@import "compass/css3";

@mixin on-circle($item-count, $circle-size, $item-size) {
position: relative;
width: $circle-size;
height: $circle-size;
border-radius: 50%;
padding: 0;

> * {
display: block;
position: absolute;
top: 50%;
left: 50%;
margin: -($item-size / 2);
width: $item-size;
height: $item-size;

$angle: (360 / $item-count);
$rot: 0;

@for $i from 1 through $item-count {
&:nth-of-type(#{$i}) {
transform: rotate($rot * 1deg) translate($circle-size / 2) rotate($rot * -1deg);
}

$rot: $rot + $angle;
}
}
}

.circle-container tr{
@include on-circle($item-count: 25, $circle-size: 20em, $item-size: 1em);
margin: 5em auto 0;
border: solid 5px tomato;

td {
display: block;
max-width: 100%;
border-radius: 50%;
filter: grayscale(100%);
border: solid 5px tomato;
transition: .15s;

&:hover {
filter: grayscale(0);
}
}
}






share|improve this answer














share|improve this answer



share|improve this answer








edited Nov 8 at 9:33

























answered Nov 8 at 9:26









לבני מלכה

7,3911323




7,3911323












  • thanks, that looks great. Just a small question if you don't mind. Do I have to use divs ?
    – Jason
    Nov 8 at 9:29










  • because inside the li was img in original one I tried to use the same... the reason is :> * { in scss
    – לבני מלכה
    Nov 8 at 9:30










  • ok, thanks a lot for your help really.
    – Jason
    Nov 8 at 9:31






  • 1




    but you can do it without I edited answer:codepen.io/leenmalka/pen/rQxEea
    – לבני מלכה
    Nov 8 at 9:32












  • great! I'll use this one :)
    – Jason
    Nov 8 at 9:33


















  • thanks, that looks great. Just a small question if you don't mind. Do I have to use divs ?
    – Jason
    Nov 8 at 9:29










  • because inside the li was img in original one I tried to use the same... the reason is :> * { in scss
    – לבני מלכה
    Nov 8 at 9:30










  • ok, thanks a lot for your help really.
    – Jason
    Nov 8 at 9:31






  • 1




    but you can do it without I edited answer:codepen.io/leenmalka/pen/rQxEea
    – לבני מלכה
    Nov 8 at 9:32












  • great! I'll use this one :)
    – Jason
    Nov 8 at 9:33
















thanks, that looks great. Just a small question if you don't mind. Do I have to use divs ?
– Jason
Nov 8 at 9:29




thanks, that looks great. Just a small question if you don't mind. Do I have to use divs ?
– Jason
Nov 8 at 9:29












because inside the li was img in original one I tried to use the same... the reason is :> * { in scss
– לבני מלכה
Nov 8 at 9:30




because inside the li was img in original one I tried to use the same... the reason is :> * { in scss
– לבני מלכה
Nov 8 at 9:30












ok, thanks a lot for your help really.
– Jason
Nov 8 at 9:31




ok, thanks a lot for your help really.
– Jason
Nov 8 at 9:31




1




1




but you can do it without I edited answer:codepen.io/leenmalka/pen/rQxEea
– לבני מלכה
Nov 8 at 9:32






but you can do it without I edited answer:codepen.io/leenmalka/pen/rQxEea
– לבני מלכה
Nov 8 at 9:32














great! I'll use this one :)
– Jason
Nov 8 at 9:33




great! I'll use this one :)
– Jason
Nov 8 at 9:33


















 

draft saved


draft discarded



















































 


draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53204616%2fcircular-html-table%23new-answer', 'question_page');
}
);

Post as a guest




















































































Popular posts from this blog

How to pass form data using jquery Ajax to insert data in database?

革兰氏阴性菌

Ruby: hitting read_timeout even when changed